﻿using hou_elearning.DataAccess.Base;
using hou_elearning.Entity;
using System;
using System.Data;
using System.Data.SqlClient;
using System.Configuration;
using System.Collections.Generic;
using System.Collections;
using System.Web;

/// <summary>
/// Summary description for CustomBRL
/// </summary>
/// 
namespace hou_elearning.Custom
{
    public class NhomnguoidungCustomBRL : SqlProvider<NhomnguoidungEntity>
    {
        public NhomnguoidungCustomBRL()
        {
            
        }

        protected static void InitReader()
        {
            getFromReader = delegate(SqlDataReader dr)
            {
                NhomnguoidungEntity entity = new NhomnguoidungEntity();
                entity.PK_iNhomnguoidungID = Int16.Parse("0" + dr["PK_iNhomnguoidungID"].ToString());
                entity.sTennhom = dr["sTennhom"].ToString();
                entity.sGhichu = dr["sGhichu"].ToString();
                return entity;
            };
        }

        public static bool bCheckDupByTennhom(String sTennhom)
        {
            string cmdName = "spNhomnguoidung_GetByTennhom";
            SqlParameter p = new SqlParameter("@sTennhom", sTennhom);
            NhomnguoidungEntity entity = GetOne(cmdName, p);
            if (entity != null)
            {
                return true;
            }
            else
            {
                return false;
            }
        }
    }
}